package com.job.netease;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @ClassName: test.Netease2_2
 * @Description:
 * @Author: 12071
 * @Date: 2022/4/21 19:29
 */
public class Netease2_2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int x = sc.nextInt();
        sc.nextLine();
        int[] nums = new int[n];
        long sum=0;
        for (int i = 0; i < n; i++) {
            nums[i] = sc.nextInt();
            sum+=nums[i];
        }
        long res=0;
        for (int i = 0; i < n; i++) {
            int r = x - (int)((sum-nums[i])%x);
            int cnt = p/x;
            if(p%x>=r)
                cnt++;
            if(nums[i]%x==r)
                cnt--;
            res+=cnt;
        }
        System.out.println(res);
    }




//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        int n = sc.nextInt();
//        int p = sc.nextInt();
//        int x = sc.nextInt();
//        sc.nextLine();
//        int[][] nums = new int[n][2];
//        int rest = 0;
//        for (int i = 0; i < n; i++) {
//            nums[i][0] = sc.nextInt();
//            nums[i][1] = nums[i][0]%x;
//            rest +=nums[i][1];
//        }
//        rest %= x;
//        int count =0;
////        for (int i = 0; i < n; i++) {
////            System.out.println(Arrays.toString(nums[i]));
////        }
////        System.out.println(x + " " +rest);
//        for (int i = 0; i < n; i++) {
////            System.out.print(i + ":\t");
//            int tmp = nums[i][0] + x - rest;
//            while (tmp<=p ){
////                System.out.print(tmp+"\t");
//                if(tmp!=nums[i][0]) count++;
//                tmp+=x;
//            }
////            System.out.print("|");
//            tmp = nums[i][0] - rest;
//            while (tmp>0){
////                System.out.print(tmp+"\t");
//                if(tmp!=nums[i][0]) count++;
//                tmp-=x;
//            }
////            System.out.println();
//        }
//        System.out.println(count);
//
//    }
}

